package com.example.nophase.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.nophase.R;
import com.example.nophase.entity.ApplyForListDTO;
import com.example.nophase.entity.InstructionsDTO;

import java.util.List;

public class CompletelAdapter extends BaseAdapter {

    List<InstructionsDTO> resultList;
    Context context;

    public CompletelAdapter(List<InstructionsDTO> resultList ,Context context) {
        this.context = context;
        this.resultList = resultList;
    }


    @Override
    public int getCount() {
        return resultList.size();
    }

    @Override
    public Object getItem(int position) {
        return resultList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view = LayoutInflater.from(context).inflate(R.layout.apply_for_list_item,null);
//        TextView applyfor_lv_item_title = view.findViewById(R.id.applyfor_lv_item_title);
        TextView applyfor_lv_item_username = view.findViewById(R.id.applyfor_lv_item_username);
        TextView applyfor_lv_no =  view.findViewById(R.id.applyfor_lv_item_no);
        TextView applyfor_lv_item_date = view.findViewById(R.id.applyfor_lv_item_date);

        InstructionsDTO item = resultList.get(position);
//        applyfor_lv_item_title.setText(String.valueOf(item.getTheme()));
        applyfor_lv_item_username.setText(item.getAppUserName());
        applyfor_lv_no.setText(item.getNo());
        applyfor_lv_item_date.setText(item.getAppDate());

        return view;
    }
}
